/*	TGThemeManager.m
 *	Part of ThinkGeek LED Clock
 *	http://tmorgan.shutupgeorge.com/thinkgeek/
 *
 * Copyright (c)2003-2006 Tim Morgan. All rights reserved. Please visit
 * http://tmorgan.shutupgeorge.com/other/license.html for more information about
 * your rights and responsibilities regarding this source code.
 */

#import "TGThemeManager.h"

const NSString *TGBackgroundStyleDefault = @"TGBackgroundStyleDefault";
const NSString *TGBackgroundStyleCustomColor = @"TGBackgroundStyleCustomColor";
const NSString *TGBackgroundStyleCustomImage = @"TGBackgroundStyleCustomImage";
const NSString *TGBackgroundStyleDesktop = @"TGBackgroundStyleDesktop";

TGThemeManager *singleton = nil;

@implementation TGThemeManager

- (void) awakeFromNib {
	themes = [NSDictionary dictionary];
	singleton = self;
}

+ (TGThemeManager *) themeManager {
	return singleton;
}

- (BOOL) isValidBackgroundStyle:(NSString *)style {
	return ([themes objectForKey:style] != nil);
}

- (BOOL) isValidClockTheme:(NSString *)theme {
	if ([theme isEqualToString:(NSString *)TGBackgroundStyleDefault]) return YES;
	if ([theme isEqualToString:(NSString *)TGBackgroundStyleCustomColor]) return YES;
	if ([theme isEqualToString:(NSString *)TGBackgroundStyleCustomImage]) return YES;
	if ([theme isEqualToString:(NSString *)TGBackgroundStyleDesktop]) return YES;
	return NO;
}

@end
